package com.jmu.posms.controller;

import com.jmu.posms.common.Result;
import com.jmu.posms.pojo.Role;
import com.jmu.posms.service.RoleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Resource
    RoleService roleService;
    @GetMapping("/get/{id}")
    public Result getUserRole(@PathVariable Integer id){
        Role role = roleService.getById(id);
        return Result.success(role);
    }

}
